package com.yunzhong.appointment.report.controller;

import com.yunzhong.appointment.report.service.IAppointmentorderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 王仁海
 * @author ThinkPad
 * @desc 医院预约压力
 */
@Controller
@RequestMapping("forms")
public class PressureController {

    @Autowired
    private IAppointmentorderService appointmentorderService;

    @RequestMapping("docpre")
    public String query(ModelMap model) {
        return "report/report/pressure";
    }


    /**
     * 查询医生被预约次数统计and医生排班预约
     *
     * @return
     */
    @RequestMapping("docprecount")
    @ResponseBody
    public Map<String,Object> queryCount(ModelMap model) {
        Map<String,Object> outMap = new HashMap<String, Object>();
        //医生预约
        List<Map<String, Object>> doctorList = appointmentorderService.queryCount();
        //医生排班预约
        List<Map<String, Object>> schedulingList = appointmentorderService.queryPb();
        outMap.put("doctorList", doctorList);
        outMap.put("schedulingList", schedulingList);
        System.out.println(doctorList);
        System.out.println(schedulingList);
        return outMap;
    }
}